<%@page import="java.io.FileOutputStream"%>
<%@page import="java.io.OutputStream"%>
<%@page import="javax.print.attribute.standard.OutputDeviceAssigned"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.io.InputStream"%>
<%@page import="com.jspsmart.upload.File"%>
<%@page import="com.jspsmart.upload.Files"%>
<%@page import="com.jspsmart.upload.SmartUpload"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>

	<%
		//方法一：组件方式
		InputStream inputStream = request.getInputStream();

		SmartUpload su = new SmartUpload();
		su.initialize(config, request, response);
		su.upload();

		for (int i = 0; i < su.getFiles().getCount(); i++) {
			File file = su.getFiles().getFile(i);
			file.saveAs("/upload/" + file.getFileName());
		}
		out.println("文件上传成功");
	%>
</body>
</html>